import random
answer = random.randint(0, 9)
N = 1
guessing = int(input("请输入0-9间的一个整数:"))
while guessing != answer:
    N = N + 1
    if guessing > answer:
        print("遗憾，太大了")
    else:
        print("遗憾，太小了")
    guessing = int(input("请输入0-9间的一个整数:"))
print("预测{}次，你猜中了！".format(N))